home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / bctex.zip / bctex / inputs / named.bst < prev    next >
Text File  |  1993-09-30  |  24KB  |  1,287 lines

  1. % BibTeX `named' style file for BibTeX version 0.99c, LaTeX version 2.09
  2. % Place it in a file called named.bst in the BibTeX search path.  (Placing it
  3. % in the same directory as the LaTeX document should also work.)
  4. % Support for named citations is provided by named.sty
  5.  
  6. % This version was made by modifying the master file made by
  7. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU)
  8.  
  9. % Copyright (C) 1985, all rights reserved.
  10. % Modifications Copyright 1988, Peter F. Patel-Schneider
  11. % Copying of this file is authorized only if either
  12. % (1) you make absolutely no changes to your copy, including name, or
  13. % (2) if you do make changes, you name it something other than
  14. % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  15. % This restriction helps ensure that all standard styles are identical.
  16.  
  17. % There are undoubtably bugs in this style.  If you make bug fixes,
  18. % improvements, etc.  please let me know.  My e-mail address is:
  19. %    pfps@research.att.com
  20.  
  21. %   Citation format: [author-last-name, year]
  22. %             [author-last-name and author-last-name, year]
  23. %             [author-last-name {\em et al.}, year]
  24. %
  25. %   Reference list ordering: alphabetical by author or whatever passes
  26. %    for author in the absence of one.
  27. %
  28. % This BibTeX style has support for short (year only) citations.  This
  29. % is done by having the citations actually look like
  30. %         \citeauthoryear{author-info}{year}
  31. % The LaTeX style has to have the following (or similar)
  32. %     \let\@internalcite\cite
  33. %     \def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
  34. %     \def\shortcite{\def\citeauthoryear##1{##2}\@internalcite}
  35. %     \def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
  36. % which makes \shortcite the macro for short citations.
  37.  
  38. ENTRY
  39.   { address
  40.     author
  41.     booktitle
  42.     chapter
  43.     edition
  44.     editor
  45.     howpublished
  46.     institution
  47.     journal
  48.     key
  49.     month
  50.     note
  51.     number
  52.     organization
  53.     pages
  54.     publisher
  55.     school
  56.     series
  57.     title
  58.     type
  59.     volume
  60.     year
  61.   }
  62.   {}
  63.   { label extra.label sort.label }
  64.  
  65. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  66.  
  67. FUNCTION {init.state.consts}
  68. { #0 'before.all :=
  69.   #1 'mid.sentence :=
  70.   #2 'after.sentence :=
  71.   #3 'after.block :=
  72. }
  73.  
  74. STRINGS { s t }
  75.  
  76. FUNCTION {output.nonnull}
  77. { 's :=
  78.   output.state mid.sentence =
  79.     { ", " * write$ }
  80.     { output.state after.block =
  81.     { add.period$ write$
  82.       newline$
  83.       "\newblock " write$
  84.     }
  85.     { output.state before.all =
  86.         'write$
  87.         { add.period$ " " * write$ }
  88.       if$
  89.     }
  90.       if$
  91.       mid.sentence 'output.state :=
  92.     }
  93.   if$
  94.   s
  95. }
  96.  
  97. FUNCTION {output}
  98. { duplicate$ empty$
  99.     'pop$
  100.     'output.nonnull
  101.   if$
  102. }
  103.  
  104. FUNCTION {output.check}
  105. { 't :=
  106.   duplicate$ empty$
  107.     { pop$ "empty " t * " in " * cite$ * warning$ }
  108.     'output.nonnull
  109.   if$
  110. }
  111.  
  112. FUNCTION {output.bibitem}
  113. { newline$
  114.  
  115.   "\bibitem[" write$
  116.   label write$
  117.   "]{" write$
  118.  
  119.   cite$ write$
  120.   "}" write$
  121.   newline$
  122.   ""
  123.   before.all 'output.state :=
  124. }
  125.  
  126. FUNCTION {fin.entry}
  127. { add.period$
  128.   write$
  129.   newline$
  130. }
  131.  
  132. FUNCTION {new.block}
  133. { output.state before.all =
  134.     'skip$
  135.     { after.block 'output.state := }
  136.   if$
  137. }
  138.  
  139. FUNCTION {new.sentence}
  140. { output.state after.block =
  141.     'skip$
  142.     { output.state before.all =
  143.     'skip$
  144.     { after.sentence 'output.state := }
  145.       if$
  146.     }
  147.   if$
  148. }
  149.  
  150. FUNCTION {not}
  151. {   { #0 }
  152.     { #1 }
  153.   if$
  154. }
  155.  
  156. FUNCTION {and}
  157. {   'skip$
  158.     { pop$ #0 }
  159.   if$
  160. }
  161.  
  162. FUNCTION {or}
  163. {   { pop$ #1 }
  164.     'skip$
  165.   if$
  166. }
  167.  
  168. FUNCTION {new.block.checka}
  169. { empty$
  170.     'skip$
  171.     'new.block
  172.   if$
  173. }
  174.  
  175. FUNCTION {new.block.checkb}
  176. { empty$
  177.   swap$ empty$
  178.   and
  179.     'skip$
  180.     'new.block
  181.   if$
  182. }
  183.  
  184. FUNCTION {new.sentence.checka}
  185. { empty$
  186.     'skip$
  187.     'new.sentence
  188.   if$
  189. }
  190.  
  191. FUNCTION {new.sentence.checkb}
  192. { empty$
  193.   swap$ empty$
  194.   and
  195.     'skip$
  196.     'new.sentence
  197.   if$
  198. }
  199.  
  200. FUNCTION {field.or.null}
  201. { duplicate$ empty$
  202.     { pop$ "" }
  203.     'skip$
  204.   if$
  205. }
  206.  
  207. FUNCTION {emphasize}
  208. { duplicate$ empty$
  209.     { pop$ "" }
  210.     { "{\em " swap$ * "}" * }
  211.   if$
  212. }
  213.  
  214. INTEGERS { nameptr namesleft numnames }
  215.  
  216. FUNCTION {format.names}
  217. { 's :=
  218.   #1 'nameptr :=
  219.   s num.names$ 'numnames :=
  220.   numnames 'namesleft :=
  221.     { namesleft #0 > }
  222.  
  223.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  224.  
  225.       nameptr #1 >
  226.     { namesleft #1 >
  227.         { ", " * t * }
  228.         { numnames #2 >
  229.         { "," * }
  230.         'skip$
  231.           if$
  232.           t "others" =
  233.         { " et~al." * }
  234.         { " and " * t * }
  235.           if$
  236.         }
  237.       if$
  238.     }
  239.     't
  240.       if$
  241.       nameptr #1 + 'nameptr :=
  242.       namesleft #1 - 'namesleft :=
  243.     }
  244.   while$
  245. }
  246.  
  247. FUNCTION {format.authors}
  248. { author empty$
  249.     { "" }
  250.     { author format.names }
  251.   if$
  252. }
  253.  
  254. FUNCTION {format.editors}
  255. { editor empty$
  256.     { "" }
  257.     { editor format.names
  258.       editor num.names$ #1 >
  259.     { ", editors" * }
  260.     { ", editor" * }
  261.       if$
  262.     }
  263.   if$
  264. }
  265.  
  266. FUNCTION {format.title}
  267. { title empty$
  268.     { "" }
  269.  
  270.     { title "t" change.case$ }
  271.  
  272.   if$
  273. }
  274.  
  275. FUNCTION {n.dashify}
  276. { 't :=
  277.   ""
  278.     { t empty$ not }
  279.     { t #1 #1 substring$ "-" =
  280.     { t #1 #2 substring$ "--" = not
  281.         { "--" *
  282.           t #2 global.max$ substring$ 't :=
  283.         }
  284.         {   { t #1 #1 substring$ "-" = }
  285.         { "-" *
  286.           t #2 global.max$ substring$ 't :=
  287.         }
  288.           while$
  289.         }
  290.       if$
  291.     }
  292.     { t #1 #1 substring$ *
  293.       t #2 global.max$ substring$ 't :=
  294.     }
  295.       if$
  296.     }
  297.   while$
  298. }
  299.  
  300. FUNCTION {format.date}
  301. { year empty$
  302.     { month empty$
  303.     { "" }
  304.     { "there's a month but no year in " cite$ * warning$
  305.       month
  306.     }
  307.       if$
  308.     }
  309.     { month empty$
  310.     'year
  311.     { month " " * year * }
  312.       if$
  313.     }
  314.   if$
  315. }
  316.  
  317. FUNCTION {format.btitle}
  318. { title emphasize
  319. }
  320.  
  321. FUNCTION {tie.or.space.connect}
  322. { duplicate$ text.length$ #3 <
  323.     { "~" }
  324.     { " " }
  325.   if$
  326.   swap$ * *
  327. }
  328.  
  329. FUNCTION {either.or.check}
  330. { empty$
  331.     'pop$
  332.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  333.   if$
  334. }
  335.  
  336. FUNCTION {format.bvolume}
  337. { volume empty$
  338.     { "" }
  339.     { "volume" volume tie.or.space.connect
  340.       series empty$
  341.     'skip$
  342.     { " of " * series emphasize * }
  343.       if$
  344.       "volume and number" number either.or.check
  345.     }
  346.   if$
  347. }
  348.  
  349. FUNCTION {format.number.series}
  350. { volume empty$
  351.     { number empty$
  352.     { series field.or.null }
  353.     { output.state mid.sentence =
  354.         { "number" }
  355.         { "Number" }
  356.       if$
  357.       number tie.or.space.connect
  358.       series empty$
  359.         { "there's a number but no series in " cite$ * warning$ }
  360.         { " in " * series * }
  361.       if$
  362.     }
  363.       if$
  364.     }
  365.     { "" }
  366.   if$
  367. }
  368.  
  369. FUNCTION {format.edition}
  370. { edition empty$
  371.     { "" }
  372.     { output.state mid.sentence =
  373.     { edition "l" change.case$ " edition" * }
  374.     { edition "t" change.case$ " edition" * }
  375.       if$
  376.     }
  377.   if$
  378. }
  379.  
  380. INTEGERS { multiresult }
  381.  
  382. FUNCTION {multi.page.check}
  383. { 't :=
  384.   #0 'multiresult :=
  385.     { multiresult not
  386.       t empty$ not
  387.       and
  388.     }
  389.     { t #1 #1 substring$
  390.       duplicate$ "-" =
  391.       swap$ duplicate$ "," =
  392.       swap$ "+" =
  393.       or or
  394.     { #1 'multiresult := }
  395.     { t #2 global.max$ substring$ 't := }
  396.       if$
  397.     }
  398.   while$
  399.   multiresult
  400. }
  401.  
  402. FUNCTION {format.pages}
  403. { pages empty$
  404.     { "" }
  405.     { pages multi.page.check
  406.     { "pages" pages n.dashify tie.or.space.connect }
  407.     { "page" pages tie.or.space.connect }
  408.       if$
  409.     }
  410.   if$
  411. }
  412.  
  413. FUNCTION {format.vol.num.pages}
  414. { volume field.or.null
  415.   number empty$
  416.     'skip$
  417.     { "(" number * ")" * *
  418.       volume empty$
  419.     { "there's a number but no volume in " cite$ * warning$ }
  420.     'skip$
  421.       if$
  422.     }
  423.   if$
  424.   pages empty$
  425.     'skip$
  426.     { duplicate$ empty$
  427.     { pop$ format.pages }
  428.     { ":" * pages n.dashify * }
  429.       if$
  430.     }
  431.   if$
  432. }
  433.  
  434. FUNCTION {format.chapter.pages}
  435. { chapter empty$
  436.     'format.pages
  437.     { type empty$
  438.     { "chapter" }
  439.     { type "l" change.case$ }
  440.       if$
  441.       chapter tie.or.space.connect
  442.       pages empty$
  443.     'skip$
  444.     { ", " * format.pages * }
  445.       if$
  446.     }
  447.   if$
  448. }
  449.  
  450. FUNCTION {format.in.ed.booktitle}
  451. { booktitle empty$
  452.     { "" }
  453.     { editor empty$
  454.     { "In " booktitle emphasize * }
  455.     { "In " format.editors * ", " * booktitle emphasize * }
  456.       if$
  457.     }
  458.   if$
  459. }
  460.  
  461. FUNCTION {empty.misc.check}
  462. { author empty$ title empty$ howpublished empty$
  463.   month empty$ year empty$ note empty$
  464.   and and and and and
  465.  
  466.   key empty$ not and
  467.  
  468.     { "all relevant fields are empty in " cite$ * warning$ }
  469.     'skip$
  470.   if$
  471. }
  472.  
  473. FUNCTION {format.thesis.type}
  474. { type empty$
  475.     'skip$
  476.     { pop$
  477.       type "t" change.case$
  478.     }
  479.   if$
  480. }
  481.  
  482. FUNCTION {format.tr.number}
  483. { type empty$
  484.     { "Technical Report" }
  485.     'type
  486.   if$
  487.   number empty$
  488.     { "t" change.case$ }
  489.     { number tie.or.space.connect }
  490.   if$
  491. }
  492.  
  493. FUNCTION {format.article.crossref}
  494. { key empty$
  495.     { journal empty$
  496.     { "need key or journal for " cite$ * " to crossref " * crossref *
  497.       warning$
  498.       ""
  499.     }
  500.     { "In {\em " journal * "\/}" * }
  501.       if$
  502.     }
  503.     { "In " key * }
  504.   if$
  505.   " \shortcite{" * crossref * "}" *
  506. }
  507.  
  508. FUNCTION {format.crossref.editor}
  509. { editor #1 "{vv~}{ll}" format.name$
  510.   editor num.names$ duplicate$
  511.   #2 >
  512.     { pop$ " et~al." * }
  513.     { #2 <
  514.     'skip$
  515.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  516.         { " et~al." * }
  517.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  518.       if$
  519.     }
  520.       if$
  521.     }
  522.   if$
  523. }
  524.  
  525. FUNCTION {format.book.crossref}
  526. { volume empty$
  527.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  528.       "In "
  529.     }
  530.     { "Volume" volume tie.or.space.connect
  531.       " of " *
  532.     }
  533.   if$
  534.   editor empty$
  535.   editor field.or.null author field.or.null =
  536.   or
  537.     { key empty$
  538.     { series empty$
  539.         { "need editor, key, or series for " cite$ * " to crossref " *
  540.           crossref * warning$
  541.           "" *
  542.         }
  543.         { "{\em " * series * "\/}" * }
  544.       if$
  545.     }
  546.     { key * }
  547.       if$
  548.     }
  549.     { format.crossref.editor * }
  550.   if$
  551.   " \shortcite{" * crossref * "}" *
  552. }
  553.  
  554. FUNCTION {format.incoll.inproc.crossref}
  555. { editor empty$
  556.   editor field.or.null author field.or.null =
  557.   or
  558.     { key empty$
  559.     { booktitle empty$
  560.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  561.           crossref * warning$
  562.           ""
  563.         }
  564.         { "In {\em " booktitle * "\/}" * }
  565.       if$
  566.     }
  567.     { "In " key * }
  568.       if$
  569.     }
  570.     { "In " format.crossref.editor * }
  571.   if$
  572.   " \shortcite{" * crossref * "}" *
  573. }
  574.  
  575. FUNCTION {article}
  576. { output.bibitem
  577.   format.authors "author" output.check
  578.   new.block
  579.   format.title "title" output.check
  580.   new.block
  581.   crossref missing$
  582.     { journal emphasize "journal" output.check
  583.       format.vol.num.pages output
  584.       format.date "year" output.check
  585.     }
  586.     { format.article.crossref output.nonnull
  587.       format.pages output
  588.     }
  589.   if$
  590.   new.block
  591.   note output
  592.   fin.entry
  593. }
  594.  
  595. FUNCTION {book}
  596. { output.bibitem
  597.   author empty$
  598.     { format.editors "author and editor" output.check }
  599.     { format.authors output.nonnull
  600.       crossref missing$
  601.     { "author and editor" editor either.or.check }
  602.     'skip$
  603.       if$
  604.     }
  605.   if$
  606.   new.block
  607.   format.btitle "title" output.check
  608.   crossref missing$
  609.     { format.bvolume output
  610.       new.block
  611.       format.number.series output
  612.       new.sentence
  613.       publisher "publisher" output.check
  614.       address output
  615.     }
  616.     { new.block
  617.       format.book.crossref output.nonnull
  618.     }
  619.   if$
  620.   format.edition output
  621.   format.date "year" output.check
  622.   new.block
  623.   note output
  624.   fin.entry
  625. }
  626.  
  627. FUNCTION {booklet}
  628. { output.bibitem
  629.   format.authors output
  630.   new.block
  631.   format.title "title" output.check
  632.   howpublished address new.block.checkb
  633.   howpublished output
  634.   address output
  635.   format.date output
  636.   new.block
  637.   note output
  638.   fin.entry
  639. }
  640.  
  641. FUNCTION {inbook}
  642. { output.bibitem
  643.   author empty$
  644.     { format.editors "author and editor" output.check }
  645.     { format.authors output.nonnull
  646.       crossref missing$
  647.     { "author and editor" editor either.or.check }
  648.     'skip$
  649.       if$
  650.     }
  651.   if$
  652.   new.block
  653.   format.btitle "title" output.check
  654.   crossref missing$
  655.     { format.bvolume output
  656.       format.chapter.pages "chapter and pages" output.check
  657.       new.block
  658.       format.number.series output
  659.       new.sentence
  660.       publisher "publisher" output.check
  661.       address output
  662.     }
  663.     { format.chapter.pages "chapter and pages" output.check
  664.       new.block
  665.       format.book.crossref output.nonnull
  666.     }
  667.   if$
  668.   format.edition output
  669.   format.date "year" output.check
  670.   new.block
  671.   note output
  672.   fin.entry
  673. }
  674.  
  675. FUNCTION {incollection}
  676. { output.bibitem
  677.   format.authors "author" output.check
  678.   new.block
  679.   format.title "title" output.check
  680.   new.block
  681.   crossref missing$
  682.     { format.in.ed.booktitle "booktitle" output.check
  683.       format.bvolume output
  684.       format.number.series output
  685.       format.chapter.pages output
  686.       new.sentence
  687.       publisher "publisher" output.check
  688.       address output
  689.       format.edition output
  690.       format.date "year" output.check
  691.     }
  692.     { format.incoll.inproc.crossref output.nonnull
  693.       format.chapter.pages output
  694.     }
  695.   if$
  696.   new.block
  697.   note output
  698.   fin.entry
  699. }
  700.  
  701. FUNCTION {inproceedings}
  702. { output.bibitem
  703.   format.authors "author" output.check
  704.   new.block
  705.   format.title "title" output.check
  706.   new.block
  707.   crossref missing$
  708.     { format.in.ed.booktitle "booktitle" output.check
  709.       format.bvolume output
  710.       format.number.series output
  711.       format.pages output
  712.       address empty$
  713.     { organization publisher new.sentence.checkb
  714.       organization output
  715.       publisher output
  716.       format.date "year" output.check
  717.     }
  718.     { address output.nonnull
  719.       format.date "year" output.check
  720.       new.sentence
  721.       organization output
  722.       publisher output
  723.     }
  724.       if$
  725.     }
  726.     { format.incoll.inproc.crossref output.nonnull
  727.       format.pages output
  728.     }
  729.   if$
  730.   new.block
  731.   note output
  732.   fin.entry
  733. }
  734.  
  735. FUNCTION {conference} { inproceedings }
  736.  
  737. FUNCTION {manual}
  738. { output.bibitem
  739.   author empty$
  740.     { organization empty$
  741.     'skip$
  742.     { organization output.nonnull
  743.       address output
  744.     }
  745.       if$
  746.     }
  747.     { format.authors output.nonnull }
  748.   if$
  749.   new.block
  750.   format.btitle "title" output.check
  751.   author empty$
  752.     { organization empty$
  753.     { address new.block.checka
  754.       address output
  755.     }
  756.     'skip$
  757.       if$
  758.     }
  759.     { organization address new.block.checkb
  760.       organization output
  761.       address output
  762.     }
  763.   if$
  764.   format.edition output
  765.   format.date output
  766.   new.block
  767.   note output
  768.   fin.entry
  769. }
  770.  
  771. FUNCTION {mastersthesis}
  772. { output.bibitem
  773.   format.authors "author" output.check
  774.   new.block
  775.   format.title "title" output.check
  776.   new.block
  777.   "Master's thesis" format.thesis.type output.nonnull
  778.   school "school" output.check
  779.   address output
  780.   format.date "year" output.check
  781.   new.block
  782.   note output
  783.   fin.entry
  784. }
  785.  
  786. FUNCTION {misc}
  787. { output.bibitem
  788.   format.authors output
  789.   title howpublished new.block.checkb
  790.   format.title output
  791.   howpublished new.block.checka
  792.   howpublished output
  793.   format.date output
  794.   new.block
  795.   note output
  796.   fin.entry
  797.   empty.misc.check
  798. }
  799.  
  800. FUNCTION {phdthesis}
  801. { output.bibitem
  802.   format.authors "author" output.check
  803.   new.block
  804.   format.btitle "title" output.check
  805.   new.block
  806.   "PhD thesis" format.thesis.type output.nonnull
  807.   school "school" output.check
  808.   address output
  809.   format.date "year" output.check
  810.   new.block
  811.   note output
  812.   fin.entry
  813. }
  814.  
  815. FUNCTION {proceedings}
  816. { output.bibitem
  817.   editor empty$
  818.     { organization output }
  819.     { format.editors output.nonnull }
  820.   if$
  821.   new.block
  822.   format.btitle "title" output.check
  823.   format.bvolume output
  824.   format.number.series output
  825.   address empty$
  826.     { editor empty$
  827.     { publisher new.sentence.checka }
  828.     { organization publisher new.sentence.checkb
  829.       organization output
  830.     }
  831.       if$
  832.       publisher output
  833.       format.date "year" output.check
  834.     }
  835.     { address output.nonnull
  836.       format.date "year" output.check
  837.       new.sentence
  838.       editor empty$
  839.     'skip$
  840.     { organization output }
  841.       if$
  842.       publisher output
  843.     }
  844.   if$
  845.   new.block
  846.   note output
  847.   fin.entry
  848. }
  849.  
  850. FUNCTION {techreport}
  851. { output.bibitem
  852.   format.authors "author" output.check
  853.   new.block
  854.   format.title "title" output.check
  855.   new.block
  856.   format.tr.number output.nonnull
  857.   institution "institution" output.check
  858.   address output
  859.   format.date "year" output.check
  860.   new.block
  861.   note output
  862.   fin.entry
  863. }
  864.  
  865. FUNCTION {unpublished}
  866. { output.bibitem
  867.   format.authors "author" output.check
  868.   new.block
  869.   format.title "title" output.check
  870.   new.block
  871.   note "note" output.check
  872.   format.date output
  873.   fin.entry
  874. }
  875.  
  876. FUNCTION {default.type} { misc }
  877.  
  878. MACRO {jan} {"January"}
  879.  
  880. MACRO {feb} {"February"}
  881.  
  882. MACRO {mar} {"March"}
  883.  
  884. MACRO {apr} {"April"}
  885.  
  886. MACRO {may} {"May"}
  887.  
  888. MACRO {jun} {"June"}
  889.  
  890. MACRO {jul} {"July"}
  891.  
  892. MACRO {aug} {"August"}
  893.  
  894. MACRO {sep} {"September"}
  895.  
  896. MACRO {oct} {"October"}
  897.  
  898. MACRO {nov} {"November"}
  899.  
  900. MACRO {dec} {"December"}
  901.  
  902. MACRO {acmcs} {"ACM Computing Surveys"}
  903.  
  904. MACRO {acta} {"Acta Informatica"}
  905.  
  906. MACRO {cacm} {"Communications of the ACM"}
  907.  
  908. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  909.  
  910. MACRO {ibmsj} {"IBM Systems Journal"}
  911.  
  912. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  913.  
  914. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  915.  
  916. MACRO {ieeetcad}
  917.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  918.  
  919. MACRO {ipl} {"Information Processing Letters"}
  920.  
  921. MACRO {jacm} {"Journal of the ACM"}
  922.  
  923. MACRO {jcss} {"Journal of Computer and System Sciences"}
  924.  
  925. MACRO {scp} {"Science of Computer Programming"}
  926.  
  927. MACRO {sicomp} {"SIAM Journal on Computing"}
  928.  
  929. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  930.  
  931. MACRO {tods} {"ACM Transactions on Database Systems"}
  932.  
  933. MACRO {tog} {"ACM Transactions on Graphics"}
  934.  
  935. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  936.  
  937. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  938.  
  939. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  940.  
  941. MACRO {tcs} {"Theoretical Computer Science"}
  942.  
  943. READ
  944.  
  945. FUNCTION {sortify}
  946. { purify$
  947.   "l" change.case$
  948. }
  949.  
  950. INTEGERS { len }
  951.  
  952. FUNCTION {chop.word}
  953. { 's :=
  954.   'len :=
  955.   s #1 len substring$ =
  956.     { s len #1 + global.max$ substring$ }
  957.     's
  958.   if$
  959. }
  960.  
  961. INTEGERS { et.al.char.used }
  962.  
  963. FUNCTION {initialize.et.al.char.used}
  964. { #0 'et.al.char.used :=
  965. }
  966.  
  967. EXECUTE {initialize.et.al.char.used}
  968.  
  969. FUNCTION {format.lab.names}
  970. { 's :=
  971.   s num.names$ 'numnames :=
  972.  
  973.   numnames #1 =
  974.     { s #1 "{vv }{ll}" format.name$ }
  975.     { numnames #2 =
  976.         { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ *
  977.         }
  978.         { s #1 "{vv }{ll }\bgroup \em et al.\egroup " format.name$ }
  979.       if$
  980.     }
  981.   if$
  982.  
  983. }
  984.  
  985. FUNCTION {author.key.label}
  986. { author empty$
  987.     { key empty$
  988.  
  989.     { cite$ #1 #3 substring$ }
  990.  
  991.     { key }
  992.       if$
  993.     }
  994.     { author format.lab.names }
  995.   if$
  996. }
  997.  
  998. FUNCTION {author.editor.key.label}
  999. { author empty$
  1000.     { editor empty$
  1001.     { key empty$
  1002.  
  1003.         { cite$ #1 #3 substring$ }
  1004.  
  1005.         { key }
  1006.       if$
  1007.     }
  1008.     { editor format.lab.names }
  1009.       if$
  1010.     }
  1011.     { author format.lab.names }
  1012.   if$
  1013. }
  1014.  
  1015. FUNCTION {author.key.organization.label}
  1016. { author empty$
  1017.     { key empty$
  1018.     { organization empty$
  1019.  
  1020.         { cite$ #1 #3 substring$ }
  1021.  
  1022.         { "The " #4 organization chop.word #3 text.prefix$ }
  1023.       if$
  1024.     }
  1025.     { key }
  1026.       if$
  1027.     }
  1028.     { author format.lab.names }
  1029.   if$
  1030. }
  1031.  
  1032. FUNCTION {editor.key.organization.label}
  1033. { editor empty$
  1034.     { key empty$
  1035.     { organization empty$
  1036.  
  1037.         { cite$ #1 #3 substring$ }
  1038.  
  1039.         { "The " #4 organization chop.word #3 text.prefix$ }
  1040.       if$
  1041.     }
  1042.     { key }
  1043.       if$
  1044.     }
  1045.     { editor format.lab.names }
  1046.   if$
  1047. }
  1048.  
  1049. FUNCTION {calc.label}
  1050. { type$ "book" =
  1051.   type$ "inbook" =
  1052.   or
  1053.     'author.editor.key.label
  1054.     { type$ "proceedings" =
  1055.     'editor.key.organization.label
  1056.     { type$ "manual" =
  1057.         'author.key.organization.label
  1058.         'author.key.label
  1059.       if$
  1060.     }
  1061.       if$
  1062.     }
  1063.   if$
  1064.   duplicate$
  1065.  
  1066.   "\protect\citeauthoryear{" swap$ * "}{" *
  1067.   year field.or.null purify$ *  % CHANGED - pfps - 15 Feb 1989
  1068.   'label :=
  1069.   year field.or.null purify$ *
  1070.  
  1071.   sortify 'sort.label :=
  1072. }
  1073.  
  1074. FUNCTION {sort.format.names}
  1075. { 's :=
  1076.   #1 'nameptr :=
  1077.   ""
  1078.   s num.names$ 'numnames :=
  1079.   numnames 'namesleft :=
  1080.     { namesleft #0 > }
  1081.     { nameptr #1 >
  1082.     { "   " * }
  1083.     'skip$
  1084.       if$
  1085.  
  1086.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1087.  
  1088.       nameptr numnames = t "others" = and
  1089.     { "et al" * }
  1090.     { t sortify * }
  1091.       if$
  1092.       nameptr #1 + 'nameptr :=
  1093.       namesleft #1 - 'namesleft :=
  1094.     }
  1095.   while$
  1096. }
  1097.  
  1098. FUNCTION {sort.format.title}
  1099. { 't :=
  1100.   "A " #2
  1101.     "An " #3
  1102.       "The " #4 t chop.word
  1103.     chop.word
  1104.   chop.word
  1105.   sortify
  1106.   #1 global.max$ substring$
  1107. }
  1108.  
  1109. FUNCTION {author.sort}
  1110. { author empty$
  1111.     { key empty$
  1112.     { "to sort, need author or key in " cite$ * warning$
  1113.       ""
  1114.     }
  1115.     { key sortify }
  1116.       if$
  1117.     }
  1118.     { author sort.format.names }
  1119.   if$
  1120. }
  1121.  
  1122. FUNCTION {author.editor.sort}
  1123. { author empty$
  1124.     { editor empty$
  1125.     { key empty$
  1126.         { "to sort, need author, editor, or key in " cite$ * warning$
  1127.           ""
  1128.         }
  1129.         { key sortify }
  1130.       if$
  1131.     }
  1132.     { editor sort.format.names }
  1133.       if$
  1134.     }
  1135.     { author sort.format.names }
  1136.   if$
  1137. }
  1138.  
  1139. FUNCTION {author.organization.sort}
  1140. { author empty$
  1141.     { organization empty$
  1142.     { key empty$
  1143.         { "to sort, need author, organization, or key in " cite$ * warning$
  1144.           ""
  1145.         }
  1146.         { key sortify }
  1147.       if$
  1148.     }
  1149.     { "The " #4 organization chop.word sortify }
  1150.       if$
  1151.     }
  1152.     { author sort.format.names }
  1153.   if$
  1154. }
  1155.  
  1156. FUNCTION {editor.organization.sort}
  1157. { editor empty$
  1158.     { organization empty$
  1159.     { key empty$
  1160.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1161.           ""
  1162.         }
  1163.         { key sortify }
  1164.       if$
  1165.     }
  1166.     { "The " #4 organization chop.word sortify }
  1167.       if$
  1168.     }
  1169.     { editor sort.format.names }
  1170.   if$
  1171. }
  1172.  
  1173. FUNCTION {presort}
  1174.  
  1175. { calc.label
  1176.   sort.label
  1177.   "    "
  1178.   *
  1179.   type$ "book" =
  1180.  
  1181.   type$ "inbook" =
  1182.   or
  1183.     'author.editor.sort
  1184.     { type$ "proceedings" =
  1185.     'editor.organization.sort
  1186.     { type$ "manual" =
  1187.         'author.organization.sort
  1188.         'author.sort
  1189.       if$
  1190.     }
  1191.       if$
  1192.     }
  1193.   if$
  1194.  
  1195.   *
  1196.  
  1197.   "    "
  1198.   *
  1199.   year field.or.null sortify
  1200.   *
  1201.   "    "
  1202.   *
  1203.   title field.or.null
  1204.   sort.format.title
  1205.   *
  1206.   #1 entry.max$ substring$
  1207.   'sort.key$ :=
  1208. }
  1209.  
  1210. ITERATE {presort}
  1211.  
  1212. SORT
  1213.  
  1214. STRINGS { longest.label last.sort.label next.extra }
  1215.  
  1216. INTEGERS { longest.label.width last.extra.num }
  1217.  
  1218. FUNCTION {initialize.longest.label}
  1219. { "" 'longest.label :=
  1220.   #0 int.to.chr$ 'last.sort.label :=
  1221.   "" 'next.extra :=
  1222.   #0 'longest.label.width :=
  1223.   #0 'last.extra.num :=
  1224. }
  1225.  
  1226. FUNCTION {forward.pass}
  1227. { last.sort.label sort.label =
  1228.     { last.extra.num #1 + 'last.extra.num :=
  1229.       last.extra.num int.to.chr$ 'extra.label :=
  1230.     }
  1231.     { "a" chr.to.int$ 'last.extra.num :=
  1232.       "" 'extra.label :=
  1233.       sort.label 'last.sort.label :=
  1234.     }
  1235.   if$
  1236. }
  1237.  
  1238. FUNCTION {reverse.pass}
  1239. { next.extra "b" =
  1240.     { "a" 'extra.label := }
  1241.     'skip$
  1242.   if$
  1243.   label extra.label * "}" * 'label :=   % CHANGED - pfps 15 Feb 1989
  1244.   label width$ longest.label.width >
  1245.     { label 'longest.label :=
  1246.       label width$ 'longest.label.width :=
  1247.     }
  1248.     'skip$
  1249.   if$
  1250.   extra.label 'next.extra :=
  1251. }
  1252.  
  1253. EXECUTE {initialize.longest.label}
  1254.  
  1255. ITERATE {forward.pass}
  1256.  
  1257. REVERSE {reverse.pass}
  1258.  
  1259. FUNCTION {begin.bib}
  1260.  
  1261. { et.al.char.used
  1262.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1263.     'skip$
  1264.   if$
  1265.   preamble$ empty$
  1266.  
  1267.     'skip$
  1268.     { preamble$ write$ newline$ }
  1269.   if$
  1270.  
  1271.   "\begin{thebibliography}{}" write$ newline$
  1272.  
  1273. }
  1274.  
  1275. EXECUTE {begin.bib}
  1276.  
  1277. EXECUTE {init.state.consts}
  1278.  
  1279. ITERATE {call.type$}
  1280.  
  1281. FUNCTION {end.bib}
  1282. { newline$
  1283.   "\end{thebibliography}" write$ newline$
  1284. }
  1285.  
  1286. EXECUTE {end.bib}
  1287.